/*
package com.spsy.order.schedule;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.Date;

*/
/**
 * @author: liuzhiping
 * @date: 2025/2/9 20:05
 **//*

@Component
public class ScheduledTasks {


    // 每隔5秒执行一次
    */
/*@Scheduled(fixedRate = 5000)
    public void taskWithFixedRate() {
        System.out.println("Fixed rate task - " + System.currentTimeMillis() / 1000);
    }*//*

    // 每隔10秒执行一次，延迟5秒后开始执行
    */
/*@Scheduled(fixedDelay = 10000, initialDelay = 5000)
    public void taskWithFixedDelay() {
        System.out.println("Fixed delay task - " + System.currentTimeMillis() / 1000);
    }*//*


    // 使用Cron表达式，每分钟的第30秒执行
    @Scheduled(cron = "10 * * * * ?")
    public void taskWithCronExpression() {
        System.out.println("Cron task - " + System.currentTimeMillis() / 1000);

        System.out.println("初始化插入50条数据到数据库");
        */
/*for(int i=0;i<50;i++){
            Orders orders = Orders.builder()
                    .orderId(Long.valueOf("1000"+i))
                    .productId("2000"+i)
                    .orderStatus("1")
                    .paymentStatus("01")
                    .payAmount(BigDecimal.ZERO)
                    .build();
            orders.setCreateTime(new Date());
            orders.setUpdateTime(new Date());
            int insertCount = this.iOrdersService.insertOrders(orders);
            System.out.println("insertCount:"+insertCount);
        }*//*

    }

    public void task(){

    }

}
*/
